{include file='header'/}
<body class="pear-admin">
<form class="layui-form" action="{:url('admin/add')}" method="post">
    <div class="mainBox">
        <div class="main-container layui-container">
            <div class="layui-form-item">
                <label class="layui-form-label required">{:__('Username')}</label>
                <div class="layui-input-block">
                    <input type="text" name="username" lay-verify="required|username" autocomplete="off"
                           placeholder="{:__('PleaseEnter %s',[__('Username')])}"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">{:__('Password')}</label>
                <div class="layui-input-block">
                    <input type="password" name="password" lay-verify="required|pwd" autocomplete="off"
                           placeholder="{:__('PleaseEnter %s',[__('Password')])}"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">{:__('RoleGroup')}</label>
                <div class="layui-input-block">
                    {foreach role_group_name as $key=>$val}
                    <input type="checkbox" id="auth_ids" name="auth_ids[]" lay-skin="primary" title="{$val}"
                           lay-verify="required" value="{$key}">
                    {/foreach}
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">{:__('Nickname')}</label>
                <div class="layui-input-block">
                    <input type="text" name="nick_name" lay-verify="required" autocomplete="off"
                           placeholder="{:__('PleaseEnter %s',[__('Nickname')])}"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item huicmf-upload">
                <label class="layui-form-label">{:__('Avatar')}</label>
                <div class="layui-input-block">
                    <input type="text" name="avatar" value=""
                           onmouseover="hui_img_preview('avatar-select-input',this.value)"
                           onmouseout="layer.closeAll();" id="avatar-select-input" autocomplete="off"
                           class="layui-input">
                    <button type="button" class="layui-btn layui-btn-normal layUpload" id="picker_pic"
                            data-multiple="false" data-input-id="avatar-select-input"
                            data-preview-id="image" data-type="image"><i class="layui-icon"></i>{:__('UploadImg')}
                    </button>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">{:__('Email')}</label>
                <div class="layui-input-block">
                    <input type="text" name="email" lay-verify="email" autocomplete="off" placeholder="{:__('PleaseEnter %s',[__('Email')])}"
                           class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">{:__('Status')}</label>
                <div class="layui-input-block">
                    <input type="radio" name="status" value="1" title="{:__('Enable')}" checked>
                    <input type="radio" name="status" value="0" title="{:__('Disable')}">
                </div>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <input type="hidden" name="__token__" value="{:token()}" />
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                    lay-filter="admin-save">
                <i class="layui-icon layui-icon-ok"></i>
                {:__('Add')}
            </button>
            <button type="reset" class="pear-btn pear-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                {:__('Reset')}
            </button>
        </div>
    </div>
</form>

{include file='footer'/}
<script>
  layui.use(['form', 'jquery'], function () {
    let form = layui.form;
    form.verify({
      username: ui_rule.username,
      pwd: ui_rule.password,
    });
  })
</script>
